package com.example.constant;

import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.Getter;

//@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum UserTypeEnum implements ValueEnum {

    USER_MANAGER(1, "管理员"),
    USER_NORMAL(2, "普通用户");

    // json处理时的映射依据
//    @JsonValue
    // mybatis查询返回的映射依据,写入数据库时需要提取该值
    @EnumValue
    @Getter
    private int code;

    @Getter
    private String message;

    UserTypeEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public int getValue() {
        return this.code;
    }
}
